package com.javaclimb.music.service.impl;

import com.javaclimb.music.mapper.SingerMapper;
import com.javaclimb.music.po.Singer;
import com.javaclimb.music.service.SingerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SingerServiceImpl implements SingerService {
    @Autowired
    private SingerMapper singerMapper;

    @Override
    public List<Singer> getSingerList() {
        return singerMapper.getSingerList();
    }

    @Override
    public boolean CreateSinger(Singer singer) {
        return singerMapper.saveSinger(singer)>0;
    }

    @Override
    public boolean DeleteSingerById(int id) {
        return singerMapper.DeleteSingerById(id)>0;
    }

    @Override
    public boolean UpdateSinger(Singer singer) {
        return singerMapper.UpdateSinger(singer)>0;
    }

    @Override
    public List<Singer> LikeSingerByName(String name) {
        return singerMapper.LikeSingerByName(name);
    }

    @Override
    public boolean DeletesSinger(int[] id) {
        return singerMapper.DeletesSinger(id)>0;
    }

    @Override
    public int getSingerNum() {
        return singerMapper.getSingerNum();
    }
}
